package practice1_100;

import java.util.HashMap;

public class Practice137 {
    public int singleNumber(int[] nums) {
        HashMap<Integer,Integer> hashMap=new HashMap();
//        hashMap.
        for (int a:nums) {
            if(!hashMap.containsKey(a)) hashMap.put(a,1);
            else hashMap.put(a,hashMap.get(a)+1);
        }
        for (Integer b:hashMap.keySet()) {
            if(hashMap.get(b)==1) return b;
        }
        return 0;
    }
}
